<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		#box{
			width: 200px;
			height: 200px;
			background: red url() 0 0 no-repeat;
			font-size: 50px;
			text-align: center;
			line-height: 200px;
			color: #fff;
		}
	</style>
	<script>
		
		window.onload= function(){

			box = document.getElementById("box")
			num =10;
			function run() {
				num--;
				box.innerHTML = num;
				if(num==0){
					clearInterval(time)
					alert("你已经 over");
				}
			}

			time =setInterval(run,1000)
		}
	</script>
</head>
<body>
	<p id="box">
		10
	</p>
</body>
</html>